package com.sxj.corejava.code07_面向对象.抽象类与接口;

/**
 * @author 石小俊
 * @date 2024年04月02日 18:21
 */
public class Test04 {

    public static void main(String[] args) {
        OtherInterface a = new OtherA();
        OtherInterface b = new OtherB();
        a.show();
        b.show();
    }

}

interface OtherInterface{
    void show();
}

class OtherA implements OtherInterface{
    @Override
    public void show() {
        System.out.println("这是OtherA重写的方法");
    }
}

class OtherB implements OtherInterface{
    @Override
    public void show() {
        System.out.println("这是OtherB重写的方法");
    }
}
